﻿using System;
using System.IO;
using Mono.Cecil.PE;

namespace Mono.Cecil.Cil
{
	// Token: 0x0200012A RID: 298
	public sealed class PortablePdbReaderProvider : ISymbolReaderProvider
	{
		// Token: 0x06000B61 RID: 2913 RVA: 0x00033BCC File Offset: 0x00031DCC
		public ISymbolReader GetSymbolReader(ModuleDefinition module, string fileName)
		{
			Mixin.CheckModule(module);
			Mixin.CheckFileName(fileName);
			FileStream fileStream = File.OpenRead(Mixin.GetPdbFileName(fileName));
			return this.GetSymbolReader(module, Disposable.Owned<Stream>(fileStream), fileStream.Name);
		}

		// Token: 0x06000B62 RID: 2914 RVA: 0x00033C0C File Offset: 0x00031E0C
		public ISymbolReader GetSymbolReader(ModuleDefinition module, Stream symbolStream)
		{
			Mixin.CheckModule(module);
			Mixin.CheckStream(symbolStream);
			return this.GetSymbolReader(module, Disposable.NotOwned<Stream>(symbolStream), symbolStream.GetFileName());
		}

		// Token: 0x06000B63 RID: 2915 RVA: 0x00033C40 File Offset: 0x00031E40
		private ISymbolReader GetSymbolReader(ModuleDefinition module, Disposable<Stream> symbolStream, string fileName)
		{
			uint num;
			return new PortablePdbReader(ImageReader.ReadPortablePdb(symbolStream, fileName, out num), module);
		}
	}
}
